+Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
+ GTK_SELECTION_NONE enum.
+ (_gtk_tree_selection_internal_select_node): ditto
+
+ * gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
+ constness.
+
+ * gtk/gtkcellrenderertoggle.c: more yummy constness.
+
+ * gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
+ if mode == GTK_SELECTION_NONE
+
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
+Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
+ GTK_SELECTION_NONE enum.
+ (_gtk_tree_selection_internal_select_node): ditto
+
+ * gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
+ constness.
+
+ * gtk/gtkcellrenderertoggle.c: more yummy constness.
+
+ * gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
+ if mode == GTK_SELECTION_NONE
+
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
+Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
+ GTK_SELECTION_NONE enum.
+ (_gtk_tree_selection_internal_select_node): ditto
+
+ * gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
+ constness.
+
+ * gtk/gtkcellrenderertoggle.c: more yummy constness.
+
+ * gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
+ if mode == GTK_SELECTION_NONE
+
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
+Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
+ GTK_SELECTION_NONE enum.
+ (_gtk_tree_selection_internal_select_node): ditto
+
+ * gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
+ constness.
+
+ * gtk/gtkcellrenderertoggle.c: more yummy constness.
+
+ * gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
+ if mode == GTK_SELECTION_NONE
+
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
+Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
+ GTK_SELECTION_NONE enum.
+ (_gtk_tree_selection_internal_select_node): ditto
+
+ * gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
+ constness.
+
+ * gtk/gtkcellrenderertoggle.c: more yummy constness.
+
+ * gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
+ if mode == GTK_SELECTION_NONE
+
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
+Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
+ GTK_SELECTION_NONE enum.
+ (_gtk_tree_selection_internal_select_node): ditto
+
+ * gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
+ constness.
+
+ * gtk/gtkcellrenderertoggle.c: more yummy constness.
+
+ * gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
+ if mode == GTK_SELECTION_NONE
+
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
+Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
+
+ * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
+ GTK_SELECTION_NONE enum.
+ (_gtk_tree_selection_internal_select_node): ditto
+
+ * gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
+ constness.
+
+ * gtk/gtkcellrenderertoggle.c: more yummy constness.
+
+ * gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
+ if mode == GTK_SELECTION_NONE
+
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
</para>
+@GTK_SELECTION_NONE:
@GTK_SELECTION_SINGLE:
@GTK_SELECTION_BROWSE:
@GTK_SELECTION_MULTIPLE:
@treeview: the object which received the signal.
+<!-- ##### SIGNAL GtkTreeView::cursor-changed ##### -->
+<para>
+
+</para>
+
+@treeview: the object which received the signal.
+
<!-- ##### SIGNAL GtkTreeView::expand-collapse-cursor-row ##### -->
<para>
gboolean (* activate) (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
- gchar *path,
+ const gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GtkCellRendererState flags);
static gboolean gtk_cell_renderer_toggle_activate (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
- const gchar *path,
+ const gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
guint flags);
GtkSelectionMode mode)
{
g_return_if_fail (GTK_IS_CLIST (clist));
+ g_return_if_fail (mode != GTK_SELECTION_NONE);
if (mode == clist->selection_mode)
return;
case GTK_SELECTION_SINGLE:
gtk_clist_unselect_all (clist);
break;
+ default:
+ /* Someone set it by hand */
+ g_assert_not_reached ();
}
}
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
row, column, event);
break;
+ default:
+ g_assert_not_reached ();
}
}
update_extended_selection (clist, clist->rows);
GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL);
return;
+ default:
+ g_assert_not_reached ();
}
}
clist->anchor = -1;
case GTK_SELECTION_BROWSE:
break;
+ default:
+ g_assert_not_reached ();
}
info = g_dataset_get_data (context, "gtk-clist-drag-source");
/* list selection modes */
typedef enum
{
+ GTK_SELECTION_NONE, /* Nothing can be selected */
GTK_SELECTION_SINGLE,
GTK_SELECTION_BROWSE,
GTK_SELECTION_MULTIPLE,
gtk_tree_selection_set_mode (GtkTreeSelection *selection,
GtkSelectionMode type)
{
+ GtkTreeSelectionFunc tmp_func;
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
if (selection->type == type)
return;
- if (type == GTK_SELECTION_SINGLE ||
- type == GTK_SELECTION_BROWSE)
+
+ if (type == GTK_SELECTION_NONE)
+ {
+ gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
+ /* We do this so that we unconditionally unset all rows
+ */
+ tmp_func = selection->user_func;
+ selection->user_func = NULL;
+ gtk_tree_selection_unselect_all (selection);
+ selection->user_func = tmp_func;
+ }
+ else if (type == GTK_SELECTION_SINGLE ||
+ type == GTK_SELECTION_BROWSE)
{
GtkRBTree *tree = NULL;
GtkRBNode *node = NULL;
gint selected = FALSE;
+ GtkTreePath *anchor_path = NULL;
if (selection->tree_view->priv->anchor)
{
- GtkTreePath *anchor_path;
-
anchor_path = gtk_tree_row_reference_get_path (selection->tree_view->priv->anchor);
if (anchor_path)
if (node && GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
selected = TRUE;
-
- gtk_tree_path_free (anchor_path);
}
}
- /* FIXME: if user_func is set, then it needs to unconditionally unselect
- * all.
+
+ /* We do this so that we unconditionally unset all rows
*/
+ tmp_func = selection->user_func;
+ selection->user_func = NULL;
gtk_tree_selection_unselect_all (selection);
+ selection->user_func = tmp_func;
- /* FIXME are we properly emitting the selection_changed signal here? */
if (node && selected)
- GTK_RBNODE_SET_FLAG (node, GTK_RBNODE_IS_SELECTED);
+ _gtk_tree_selection_internal_select_node (selection,
+ node,
+ tree,
+ anchor_path,
+ 0);
+ gtk_tree_path_free (anchor_path);
}
+
selection->type = type;
}
gint dirty = FALSE;
GtkTreePath *anchor_path = NULL;
+ if (selection->type == GTK_SELECTION_NONE)
+ return;
if (selection->tree_view->priv->anchor)
anchor_path = gtk_tree_row_reference_get_path (selection->tree_view->priv->anchor);
ssmodel = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (smodel));
*/
tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
-
/* 12 iters now, 12 later... */
for (i = 0; data[i].word_1 != NULL; i++)
{